<template>
  <view>
<!--    <unicloud-db v-slot:default="{data, loading, error, options}" collection="homemaindata">
      <view v-if="error">{{error.message}}</view>
      <view v-else>
        {{data}} 
      </view>
    </unicloud-db> -->
    <image :src="imageList" mode="aspectFill"></image>
    <!-- {{dataList}} -->
  </view>
</template>

<script>
  export default {
    data() {
      return {
        dataList: [],
        imageList:'//vkceyugu.cdn.bspapp.com/VKCEYUGU-65038a5c-ac25-49b6-bd9c-dbf1d1e9726b/c0432cf0-3a67-4891-8bc4-b1d0ce15cf9b.png',
      };
    },
    onLoad() {
      this.getDatebaseDate()
    },
    methods: {
      async getDatebaseDate() {
        // 获取db引用
        const db = uniCloud.database() //代码块为cdb
        // 使用uni-clientDB
        db.collection('homemaindata')
          .where('floor_title.name == "时尚女装"')
        	.get()
          .then((res)=>{
            // res 为数据库查询结果
            this.dataList = res.result.data
            console.log(this.dataList)
          }).catch((err)=>{
            console.log(err.code); // 打印错误码
        		console.log(err.message); // 打印错误内容
          })
      },
    },
  }
  
  
</script>

<style lang="scss">

</style>
